/**
 * 时间 ： 2014-5-27 上午9:33:27
 * 作者 ： HaiTao
 * 描述 ： 当前类的描述信息
 **/
package com.laitaoo.service
{
	import com.laitaoo.event.KindsEvent;
	import com.laitaoo.utils.Utils;
	import com.maclema.mysql.Connection;
	import com.maclema.mysql.MySqlToken;
	import com.maclema.mysql.ResultSet;
	import com.maclema.mysql.Statement;
	
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	import mx.rpc.AsyncResponder;

	public class BaseService extends EventDispatcher
	{
		public var connection:Connection;
		
		public var st:Statement;
		
		public function BaseService()
		{
			connection = Utils.getInstance()._con;
			
			st = connection.createStatement();
		}
		
		protected function getKindList(resultHandler:Function,faultHandler:Function):void{
			
			var sql:String = "select * from kinds";
			
			var token:MySqlToken = st.executeQuery(sql);
			
			token.addResponder(new AsyncResponder(resultHandler,resultHandler,token));
		}
	}
}